#pragma once
#include "RBTree.h"

namespace ztb
{
	template<class K>
	class Myset
	{
		struct SetOFV
		{
			const K& operator()(const K& k)
			{
				return k;
			}
		};
	public:
		typedef typename RBTree<K, K, SetOFV>::const_iterator iterator;
		typedef typename RBTree<K, K, SetOFV>::const_iterator const_iterator;

		const_iterator begin()const
		{
			return _st.begin();
		}
		const_iterator end()const
		{
			return _st.end();
		}

		pair<iterator, bool> Insert(const K& key)
		{
			// pair<RBTree::iterator, bool>
			pair<typename RBTree<K, K, SetOFV>::iterator, bool> ret = _st.Insert(key);
			return pair<iterator, bool>(ret.first, ret.second);
		}

	private:
		RBTree<K, K, SetOFV> _st;
	};
}